package com.restaurant.application.couponmanage.support;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.lang.String;
import java.util.List;

public class CreatePateTypeData implements PickableBean {
    
    public static final String FN_TYPE = "type";
    
    public static final List<String> FIELD_NAMES = Lists.newArrayList(
             FN_TYPE);
    
    private String type;
    
    public CreatePateTypeData(String type) {
        setType(type);
    }
    
    public CreatePateTypeData() {
    }
    
    public CreatePateTypeData duplicate() {
        CreatePateTypeData result = new CreatePateTypeData();
        result.type = this.type;
        return result;
    }
    
    @Override
    public String toString() {
        return Convert.toJson(this);
    }
    
    public String getType() {
        return type;
    }
    
    public void  setType(String value) {
        this.type = value;
    }
    
    public CreatePateTypeData withType(String value) {
        setType(value);
        return this;
    }
    
    public CreatePateTypeData withType(String value, String defaultValue) {
        setType(value == null ? defaultValue : value);
        return this;
    }
    
    public Object getValueOf(String name) {
        switch(name) {
        case "type": return getType();
        }
        return null;
    }
    
    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }
    
    @Override
    public int hashCode() {
        return signature().hashCode();
    }
    
    @Override
    public boolean equals(Object o) {
        if(!(o instanceof CreatePateTypeData)) return false;
        return signature().equals(((CreatePateTypeData)o).signature());
    }
    
    public String signature() {
        throw new RuntimeException("Bean CreatePateTypeData has no signature defined, no hash code or equals possible.");
    }
}
